//package cn.wbnyua.resume.api.api1;
//
//import cn.wbnyua.resume.core.exception.RuntimeExceptionHandler;
//import cn.wbnyua.resume.mvc.domain.Projects;
//import cn.wbnyua.resume.mvc.service.v1.ProjectsService;
//import cn.wbnyua.resume.util.JsonResponse;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * 作者：wbnyua.
// * 创建时间: 2023/2/7 14:15.
// */
//@RestController
//@RequestMapping("/api/projects")
//public class ProjectsApi {
//    @Autowired
//    private ProjectsService service;
//
//    @GetMapping
//    public JsonResponse<List<Projects>> list(){
//        return new JsonResponse<>(service.findAll());
//    }
//
//    @GetMapping("/{id}")
//    public JsonResponse<Projects> findById(@PathVariable Long id){
//        return new JsonResponse<>(service.findById(id));
//    }
//    @PostMapping
//    public JsonResponse<String> add(Projects projects){
//        service.add(projects);
//        return JsonResponse.success();
//    }
//
//    @PutMapping
//    public JsonResponse<String> update(Projects projects){
//        if (projects.getId()==null){
//            throw new RuntimeExceptionHandler("用户数据有误");
//        }
//        service.update(projects);
//        return JsonResponse.success();
//    }
//
//
//    @DeleteMapping("/{id}")
//    public JsonResponse<String> remove(@PathVariable Long id){
//        if (id==null){
//            throw new RuntimeExceptionHandler("请输入删除的编号");
//        }
//        service.remove(id);
//        return JsonResponse.success();
//    }
//}
